package com.cskaoyan.last.print;

/**
 * @author 徐文祥
 * @since 2023/05/09 21:44
 */
public class LetterPrinter extends Thread {
    private Printer printer;
    private char c = 'A';

    public LetterPrinter(Printer printer) {
        this.printer = printer;
    }

    @Override
    public void run() {
        while (true) {
            printer.print(c);
            if (c == 'Z') {
                break;
            }
            c++;
        }
    }
}
